"""OWN-5: one line per comparison in pics/cmp/*.json with its worst pair (lowest PSNR), and pics/index.html. python -I -B summarize.py """ import html import json import math import sys from pathlib import Path root = Path(sys.argv[1]) items = [] for f in sorted((root / "cmp").glob("*.json")): d = json.loads(f.read_text()) s, pairs = d["summary"], [p for p in d["pairs"] if "error" not in p] worst = min(pairs, key=lambda p: p["psnr_db"]) if pairs else None items.append((s, worst)) w = "-" if worst is None or math.isinf(worst["psnr_db"]) else f"{worst['name']} (PSNR {worst['psnr_db']:.1f}, SSIM {worst['ssim']:.3f}, max {worst['max_abs']:.0f})" print(f"{s['label']}: {s['bytes_equal']}/{s['pairs']} identical; worst {w}") h = ["OWN-5 same seed", "", "

OWN-5: the same seed, picture pairs

Each link shows A | B | |A-B| x 8 for every pair, worst first is listed here.

"]), encoding="utf-8")